#!/bin/sh
set -e
# Currently curtin doesn't call flash-kernel after installing kernel
# and generating initrd, but we need it on arm64
# and we need to update-grub after flash-kernel installed dtb
if [ -e /target/usr/sbin/flash-kernel ]; then
	FK_FORCE=yes $SNAP/bin/subiquity/bin/subiquity-cmd curtin in-target -t /target -- flash-kernel
fi
if [ -e /target/usr/sbin/update-grub ]; then
	$SNAP/bin/subiquity/bin/subiquity-cmd curtin in-target -t /target -- update-grub
fi
